package com.yoso.springcloud.domain;


import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @Description:
 * @Date: 2021/10/12 17:08
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
public class CommonResult<T> implements Serializable {
    private Integer code;
    private String message;
    private T data;
    public CommonResult(T data,String port){
        if (data != null) {
            this.code = 200;
            this.message = "port:" + port +"  success";
            this.data = data;
        }else {
            this.code = 444;
            this.message = "port:" + port +"  fail";
        }
    }
}
